package com.example.yskjproject.utils;

import com.example.yskjproject.content.SpContent;

/**
 * SpCashUtils
 * <p>
 * 作者：zx
 * 创建时间：2024/4/19
 */

public class SpCashUtils {

    private static SpCashUtils instance;

    public synchronized static SpCashUtils getInstance() {
        if (instance == null) {
            instance = new SpCashUtils();
        }
        return instance;
    }

    public String getToken() {
        return SpManager.getString(SpContent.TOKEN, "");
    }

    public void setToken(String token) {
        SpManager.put(SpContent.TOKEN, token);
    }

    //token过期时间
    public Integer getTokenTime(){
        return  SpManager.getInt(SpContent.TOKEN_TIME);
    }

    public void setTokenTime(Integer time){
        SpManager.put(SpContent.TOKEN_TIME,time);
    }

    //token获取的时间
    public String getCurrentTokenTime(){
        return  SpManager.getString(SpContent.CURRENT_TOKEN_TIME);
    }

    public void setCurrentTokenTime(String time){
        SpManager.put(SpContent.CURRENT_TOKEN_TIME,time);
    }

    //--YM
    public String getDeviceToken() {
        return SpManager.getString(SpContent.DEVICE_TOKEN, "");
    }

    public void setDeviceToken(String deviceToken) {
        SpManager.put(SpContent.DEVICE_TOKEN, deviceToken);
    }

    // ticket
    public String getTicket() {
        return SpManager.getString(SpContent.TICKET);
    }

    public void setTicket(String ticket) {
        SpManager.put(SpContent.TICKET, ticket);
    }


    //userId
    public int getUserId() {
        return SpManager.getInt(SpContent.USERID);
    }

    public void setUserId(int userId) {
        SpManager.put(SpContent.USERID, userId);
    }


    public int getWorkId() {
        return SpManager.getInt(SpContent.WORK_ID);
    }

    public void setWorkId(int wordId) {
        SpManager.put(SpContent.WORK_ID, wordId);
    }

}
